﻿using System;
using System.Buffers.Text;
using System.Text;

namespace Unity.Kafka.Client.Examples
{
    public class FormatterExample
    {
        public static void Main(string[] args)
        {
            byte[] buffer = new byte[0];
            DateTime value = DateTime.Now;

            int index = 0;
            bool result = Utf8Formatter.TryFormat(value, buffer.AsSpan(index), out var written);
            Console.WriteLine(result);
            Console.WriteLine(Encoding.ASCII.GetString(buffer));
            Console.WriteLine(written);
        }
    }
}